package main.model;

import java.util.Collections;
import java.util.Date;
import java.util.Iterator;
import java.util.Set;


/**
 * Null Object pattern for handling null cases better.
 *
 * @author Kevin Gao
 *
 */
public class NullModel extends DataModel {

    private final Set<Day> myData;
    private final Day myNullDay = new Day(new Date(), 0, 0, 0, 0, 0);

    /**
     * Default constructor for null model. Don't take in a controller.
     */
    public NullModel () {
        super();
        myData = Collections.emptySet();
    }

    @Override
    public void setName(String name) {
        return;
    }

    @Override
    public Iterator<Day> iterator () {
        return myData.iterator();
    }

    @Override
    public Day getMaxRow () {
        return myNullDay;
    }

    @Override
    public Day getMinRow () {
        return myNullDay;
    }

    @Override
    public Day getFirstRow () {
        return myNullDay;
    }

    @Override
    public Day getLastRow () {
        return myNullDay;
    }

    @Override
    public int getSizeOfData () {
        return 0;
    }

    @Override
    public void addRow (Day d) {
        return;
    }

    @Override
    public boolean isEmpty () {
        return true;
    }

}
